﻿using System;
using System.IO;
using UnityEngine;

namespace Studio
{
	// Token: 0x020004A6 RID: 1190
	public class ChangeAmount
	{
		// Token: 0x06001DB4 RID: 7604 RVA: 0x000BC520 File Offset: 0x000BA720
		public ChangeAmount()
		{
			this.m_Pos = Vector3.zero;
			this.m_Rot = Vector3.zero;
			this.m_Scale = Vector3.one;
		}

		// Token: 0x17000329 RID: 809
		// (get) Token: 0x06001DB5 RID: 7605 RVA: 0x000BC578 File Offset: 0x000BA778
		// (set) Token: 0x06001DB6 RID: 7606 RVA: 0x000BC580 File Offset: 0x000BA780
		public Vector3 pos
		{
			get
			{
				return this.m_Pos;
			}
			set
			{
				if (Utility.SetStruct<Vector3>(ref this.m_Pos, value) && this.onChangePos != null)
				{
					this.onChangePos();
				}
			}
		}

		// Token: 0x1700032A RID: 810
		// (get) Token: 0x06001DB7 RID: 7607 RVA: 0x000BC5AC File Offset: 0x000BA7AC
		// (set) Token: 0x06001DB8 RID: 7608 RVA: 0x000BC5B4 File Offset: 0x000BA7B4
		public Vector3 rot
		{
			get
			{
				return this.m_Rot;
			}
			set
			{
				if (Utility.SetStruct<Vector3>(ref this.m_Rot, value) && this.onChangeRot != null)
				{
					this.onChangeRot();
				}
			}
		}

		// Token: 0x1700032B RID: 811
		// (get) Token: 0x06001DB9 RID: 7609 RVA: 0x000BC5E0 File Offset: 0x000BA7E0
		// (set) Token: 0x06001DBA RID: 7610 RVA: 0x000BC5E8 File Offset: 0x000BA7E8
		public Vector3 scale
		{
			get
			{
				return this.m_Scale;
			}
			set
			{
				if (Utility.SetStruct<Vector3>(ref this.m_Scale, value) && this.onChangeScale != null)
				{
					this.onChangeScale(value);
				}
			}
		}

		// Token: 0x06001DBB RID: 7611 RVA: 0x000BC614 File Offset: 0x000BA814
		public void Save(BinaryWriter _writer)
		{
			_writer.Write(JsonUtility.ToJson(this.m_Pos));
			_writer.Write(JsonUtility.ToJson(this.m_Rot));
			_writer.Write(JsonUtility.ToJson(this.m_Scale));
		}

		// Token: 0x06001DBC RID: 7612 RVA: 0x000BC664 File Offset: 0x000BA864
		public void Load(BinaryReader _reader)
		{
			this.m_Pos = JsonUtility.FromJson<Vector3>(_reader.ReadString());
			this.m_Rot = JsonUtility.FromJson<Vector3>(_reader.ReadString());
			this.m_Scale = JsonUtility.FromJson<Vector3>(_reader.ReadString());
		}

		// Token: 0x06001DBD RID: 7613 RVA: 0x000BC69C File Offset: 0x000BA89C
		public ChangeAmount Clone()
		{
			return new ChangeAmount
			{
				pos = new Vector3(this.m_Pos.x, this.m_Pos.y, this.m_Pos.z),
				rot = new Vector3(this.m_Rot.x, this.m_Rot.y, this.m_Rot.z),
				scale = new Vector3(this.m_Scale.x, this.m_Scale.y, this.m_Scale.z)
			};
		}

		// Token: 0x06001DBE RID: 7614 RVA: 0x000BC734 File Offset: 0x000BA934
		public void Copy(ChangeAmount _source, bool _pos = true, bool _rot = true, bool _scale = true)
		{
			if (_pos)
			{
				this.pos = _source.pos;
			}
			if (_rot)
			{
				this.rot = _source.rot;
			}
			if (_scale)
			{
				this.scale = _source.scale;
			}
		}

		// Token: 0x06001DBF RID: 7615 RVA: 0x000BC770 File Offset: 0x000BA970
		public void OnChange()
		{
			if (this.onChangePos != null)
			{
				this.onChangePos();
			}
			if (this.onChangeRot != null)
			{
				this.onChangeRot();
			}
			if (this.onChangeScale != null)
			{
				this.onChangeScale(this.scale);
			}
		}

		// Token: 0x06001DC0 RID: 7616 RVA: 0x000BC7C8 File Offset: 0x000BA9C8
		public void Reset()
		{
			this.pos = Vector3.zero;
			this.rot = Vector3.zero;
			this.scale = Vector3.one;
		}

		// Token: 0x0400203F RID: 8255
		protected Vector3 m_Pos = Vector3.zero;

		// Token: 0x04002040 RID: 8256
		protected Vector3 m_Rot = Vector3.zero;

		// Token: 0x04002041 RID: 8257
		protected Vector3 m_Scale = Vector3.one;

		// Token: 0x04002042 RID: 8258
		public Action onChangePos;

		// Token: 0x04002043 RID: 8259
		public Action onChangeRot;

		// Token: 0x04002044 RID: 8260
		public Action<Vector3> onChangeScale;
	}
}
